<?php

class koneksi_db{
	protected $host = "127.0.0.1";
	protected $db	= "db_stapala";
	protected $user = "root";
	protected $pass = "";
	
	public $con;
	
	function __construct(){
		$this->con;
	}
	
	function koneksi(){
		try{
			$this->con = new PDO("mysql:host=$this->host;dbname=$this->db",$this->user,$this->pass);
			$this->con->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
 
        } catch(PDOException $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
	}
}

?>